<template>
	<view>
		
		<!-- <web-view src="https://eos.douyin.com/livesite/live/current"></web-view> -->
	</view>
</template>

<script>
	var wv; //计划创建的webview
	export default {
		name: "ctrlLive",
		data() {
			return {

			};
		},

		mounted() {
			console.log(111);
			// #ifdef APP-PLUS
			//此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效
			var wv = plus.webview.create('https://eos.douyin.com/livesite/live/current')
			wv.show()

			wv.evalJS('document.title = "标题"')

			wv.addEventListener('loaded', () => {
				console.log('New Window loaded!');
				wv.show(); // 显示窗口

				wv.setStyle({
					// top: -500,
					top: 150,
					height: 500,
					opacity: 1
				})

				wv.evalJS(`
						  var mask = document.createElement('div')
						  mask.className = 'mask'
						  document.getElementById('root').appendChild(mask)
							mask.style.position='absolute'
							mask.style.top=0
							mask.style.left=0
							mask.style.bottom=0
							mask.style.right= 0
							mask.style.width= '100vw'
							mask.style.height= '100vh'
							mask.style.zIndex=9999
						`)

			}, false);

			// #endif

		}
	}
</script>

<style>

</style>